package com.mmg.cosplay.service;

import dev.langchain4j.service.MemoryId;
import dev.langchain4j.service.SystemMessage;
import dev.langchain4j.service.UserMessage;
import dev.langchain4j.service.V;
import dev.langchain4j.service.spring.AiService;
import dev.langchain4j.service.spring.AiServiceWiringMode;
import reactor.core.publisher.Flux;

@AiService(
        wiringMode = AiServiceWiringMode.EXPLICIT,//手动装配
        chatMemoryProvider = "chatMemoryProvider",//指定会话记忆提供者bean名称
        chatModel = "qwenChatModel",//指定模型
        streamingChatModel = "qwenStreamingChatModel",//指定流式模型
        tools = "webSearchEngineTool"//指定工具
)
public interface ChatService {

    @SystemMessage("{{systemMessage}}")
    String chat(
            @MemoryId String memoryId,
            @V("systemMessage") String systemMessage,
            @UserMessage String message);

    @SystemMessage("{{systemMessage}}")
    Flux<String> fluxChat(
            @MemoryId String memoryId,
            @V("systemMessage") String systemMessage,
            @UserMessage String message);

}
